package com.bawan.mail;

import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;

/**
 * Desc:   邮件授权类
 * Author: zhengcongchun
 * CreateTime: 2014-03-17 11:29
 * LastModifyTime: 2014-03-17 11:29
 * FinalModifier: zhengcongchun
 * Version: 1.0
 */
public class MyAuthenticator extends Authenticator {
    private String strUser;
    private String strPwd;

    public MyAuthenticator(String user, String password) {
        this.strUser = user;
        this.strPwd = password;
    }

    protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(strUser, strPwd);
    }
}